package com.meida.app.provider.controller;

import com.meida.common.mybatis.model.*;
import com.meida.common.springmvc.base.BaseController;
import com.meida.module.user.client.entity.AppMenu;
import com.meida.module.user.provider.service.AppMenuService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;


/**
 * 系统资源-菜单信息控制器
 *
 * @author flyme
 * @date 2019-06-27
 */
@RestController
@RequestMapping("/menu")
@Api(tags = "公共服务")
@ApiIgnore
public class AppMenuController extends BaseController<AppMenuService, AppMenu> {

    /**
     * 系统资源-菜单信息分页列表
     *
     * @param pageModel
     * @return
     */
    @GetMapping(value = "pageList")
    public ResultBody pageList(@ModelAttribute(value = "pageModel") PageModel pageModel) {
        return bizService.pageList(pageModel);
    }

    /**
     * 系统资源-菜单信息列表
     *
     * @param model
     * @return
     */
    @GetMapping(value = "list")
    public ResultBody list(@ModelAttribute(value = "model") ListModel model) {
        return bizService.listEntityMap(model);
    }

    /**
     * 添加系统资源-菜单信息
     *
     * @param model
     * @return
     */
    @PostMapping(value = "add")
    public ResultBody add(SaveModel model) {
        return bizService.add(model);
    }

    /**
     * 更新系统资源-菜单信息
     *
     * @param model
     * @return
     */
    @PostMapping(value = "update")
    public ResultBody update(UpdateModel model) {
        return bizService.edit(model);
    }

    /**
     * 删除系统资源-菜单信息
     *
     * @param model
     * @return
     */
    @PostMapping(value = "remove")
    public ResultBody remove(DeleteModel model) {
        return bizService.delete(model);
    }
}
